package ${package.Entity};

<#list table.importPackages as pkg>
import ${pkg};
</#list>
<#list enumImportPackages as enumImportPackage>
import ${enumImportPackage};
</#list>
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serial;


/**
 * <p>
 * ${table.comment!}
 * </p>
 *
 * @author ${author}
 * @since ${date}
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@TableName("${schemaName}${table.name}")
@Schema(name = "${entity}", description = "${table.comment!}")
public class ${entity} extends ${baseEntityName}<${primaryKeyType}> implements Serializable {

    @Serial
    @TableField(exist = false)
    private static final long serialVersionUID = ${serialVersionUIDList[0]}L;

<#-- ----------  BEGIN 字段循环遍历  ---------->
<#list EntityFields as field>
    <#if field.keyFlag>
        <#assign keyPropertyName="${field.propertyName}"/>
    </#if>
    <#if field.comment!?length gt 0>
    /**
     * ${field.comment}
     */
    @Schema(description = "${field.comment}")
    </#if>
    <#if field.keyFlag>
    <#-- 主键 -->
    @TableId(value = "${field.propertyName}", type = IdType.AUTO)
    </#if>
    <#if field.enum>
    private ${field.enumClassName} ${field.propertyName};
    <#else >
    private ${field.propertyType} ${field.propertyName};
    </#if>
</#list>
<#------------  END 字段循环遍历  ---------->
}
